1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
| <?php
return [
'backup' => [
/* * The name of this application. You can use this name to monitor * the backups. */ //'name' => env('APP_URL'), //这个备份时的目录名,如果是服务器上域名是不错的不过本地的话改一下比较好 'name' => 'elick blog',
'source' => [ //这个强大啊 还能备份文件 'files' => [
/* * The list of directories that should be part of the backup. You can * specify individual files as well. * 这个是目录迭代器 但是当迭代node_modules时会出错 所以注销了 * 这样也就无法备份文件系统了 明天可以试试把排除放在前面看看可不可以 * 排除放在前面也不可以,但是可以挨个指定目录或文件 * 没有这个迭代还不可以 只有排除是不行的 * node_modules还是不行 里面全是链接目录一层套一层的 也不知道怎么搞的 不知道其他项目node目录是不是也这样 */ 'include' => [ //base_path(), base_path('app'), // base_path('artisan'), //目录和单个文件都是可以的 ],
// * These directories will be excluded from the backup. // * You can specify individual files as well.
'exclude' => [ base_path('vendor'), base_path('node_modules'), storage_path(), base_path('.git'), base_path('.idea'), ],
/* * Determines if symlinks should be followed. */ 'followLinks' => false, ],
/* * The names of the connections to the databases that should be part of the backup. * Currently only MySQL- and PostgreSQL-databases are supported. */ 'databases' => [ 'mysql', ], ],
'destination' => [
/* * The disk names on which the backups will be stored. * 保存位置在这 * storage\app\http---localhost */ 'disks' => [ 'local', //这个配置位置在 config/filesystems.php 'backup', //这个就是我自己加的 ], ], ],
'cleanup' => [ /* * The strategy that will be used to cleanup old backups. * The youngest backup will never be deleted. */ 'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class,
'defaultStrategy' => [
/* * The amount of days that all backups must be kept. */ 'keepAllBackupsForDays' => 7,
/* * The amount of days that all daily backups must be kept. */ 'keepDailyBackupsForDays' => 16,
/* * The amount of weeks of which one weekly backup must be kept. */ 'keepWeeklyBackupsForWeeks' => 8,
/* * The amount of months of which one monthly backup must be kept. */ 'keepMonthlyBackupsForMonths' => 4,
/* * The amount of years of which one yearly backup must be kept. */ 'keepYearlyBackupsForYears' => 2,
/* * After cleaning up the backups remove the oldest backup until * this amount of megabytes has been reached. */ 'deleteOldestBackupsWhenUsingMoreMegabytesThan' => 5000, ], ],
/* * In this array you can specify which backups should be monitored. * If a backup does not meet the specified requirements the * UnHealthyBackupWasFound-event will be fired. */ 'monitorBackups' => [ [ 'name' => env('APP_URL'), 'disks' => ['local'], 'newestBackupsShouldNotBeOlderThanDays' => 1, 'storageUsedMayNotBeHigherThanMegabytes' => 5000, ],
/* [ 'name' => 'name of the second app', 'disks' => ['local', 's3'], 'newestBackupsShouldNotBeOlderThanDays' => 1, 'storageUsedMayNotBeHigherThanMegabytes' => 5000, ], */ ],
'notifications' => [
/* * This class will be used to send all notifications. */ 'handler' => Spatie\Backup\Notifications\Notifier::class,
/* * Here you can specify the ways you want to be notified when certain * events take place. Possible values are "log", "mail", "slack", * "pushover", and "telegram". * * Slack requires the installation of the maknz/slack package. * Telegram requires the installation of the irazasyed/telegram-bot-sdk package. */ 'events' => [ 'whenBackupWasSuccessful' => ['log'], 'whenCleanupWasSuccessful' => ['log'], 'whenHealthyBackupWasFound' => ['log'], 'whenBackupHasFailed' => ['log', 'mail'], 'whenCleanupHasFailed' => ['log', 'mail'], 'whenUnhealthyBackupWasFound' => ['log', 'mail'], ],
/* * Here you can specify how emails should be sent. */ 'mail' => [ 'from' => 'your@email.com', 'to' => 'your@email.com', ],
/* * Here you can specify how messages should be sent to Slack. */ 'slack' => [ 'channel' => '#backups', 'username' => 'Backup bot', 'icon' => ':robot:', ],
/* * Here you can specify how messages should be sent to Pushover. */ 'pushover' => [ 'token' => env('PUSHOVER_APP_TOKEN'), 'user' => env('PUSHOVER_USER_KEY'), 'sounds' => [ 'success' => env('PUSHOVER_SOUND_SUCCESS', 'pushover'), 'error' => env('PUSHOVER_SOUND_ERROR', 'siren'), ], ],
/* * Here you can specify how messages should be sent to Telegram Bot API. */ 'telegram' => [ 'bot_token' => env('TELEGRAM_BOT_TOKEN'), 'chat_id' => env('TELEGRAM_CHAT_ID'), 'async_requests' => env('TELEGRAM_ASYNC_REQUESTS', false), 'disable_web_page_preview' => env('TELEGRAM_DISABLE_WEB_PAGE_PREVIEW', true), ], ], ];
|